/**
  ******************************************************************************
  * @file   log.c
  * @author Administrator
  * @since  2024/7/30
  *
  * @brief  Hardware/Peripheral driver of Xxx(Hardware/Simulation-Implemented).
  *
  ******************************************************************************
  */
#include <stdarg.h>
#include <stdio.h>
#include "log.h"

extern int log_level;

void log_output(enum log_levels level, const char *file, unsigned line,
                const char *function, const char *format, ...) {
    if (log_level >= level) {
        printf("%s:%-3d, %s():", file, line, function);

        va_list args;
        va_start(args, format);
        vprintf(format, args);
        va_end(args);
    }
}

